***********************************************************************************
* THE LOSER'S LONG CURSE: HOW EXPOSURE TO CLASS CONFLICT SHAPES ELECTION OUTCOMES *
***********************************************************************************

* This file reproduces the following tables and figures in our manuscript:
* Table 6, Figure OA10, Figure OA11, Figure OA12, and Table OA10.

* For all other analyses, see main_analyses.do or appendix_analyses.do!

********************************************************************************

* Set up working folders --- NB. Replace these with your own paths!

global data " "
global tables " "
global figures " "

********************************************************************************

* Open the data set

use "$data/MM_data_long_run.dta", clear

********************************************************************************

* Table 6

preserve

// Generate some variables needed for the analysis & drop unnecessary years

gen post = 0
replace post = 1 if year >= 1917

drop if year >= 1917 & year <= 1936

bysort munig post: egen mean_center = mean(agrarian_party)
bysort munig post: egen mean_right = mean(right_wing)
bysort munig post: egen mean_red = mean(red_parties)

gen post_dead=dead*post
gen post_insurgency=insurgency*post
gen post_whitedead=whitedead*post

duplicates drop munig post, force

est clear

reg mean_red c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
display beta
eststo: reghdfe mean_red post_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_dead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_insurgency if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_whitedead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_dead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_insurgency if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_whitedead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

esttab est* using "$tables/table_6.tex", replace  mgroups("Entire country" "Red Finland" "White Finland",  pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) )  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean beta, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean" "Standardized effect size") ///
	fmt(0 2 2 2)) keep(post_dead post_insurgency post_whitedead ) coeflabels(post_dead "Civil war casualties $\times$ 1[Year $\geq$ 1917]" ///
	post_insurgency "Red casualties $\times$ 1[Year $\geq$ 1917]" post_whitedead "White casualties $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle ///
	prehead(\begin{tabular}{l*{10}{c}} \toprule) refcat(post_dead "\textbf{Panel A:} Left-wing parties", nolabel) ///
	postfoot( )

est clear

reg mean_center c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
display beta
eststo: reghdfe mean_center post_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_dead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_insurgency if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_whitedead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_dead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_insurgency if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_whitedead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

esttab est* using "$tables/table_6.tex", append  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean beta, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean" "Standardized effect size") ///
	fmt(0 2 2 2)) keep(post_dead post_insurgency post_whitedead ) coeflabels(post_dead "Civil war casualties $\times$ 1[Year $\geq$ 1917]" ///
	post_insurgency "Red casualties $\times$ 1[Year $\geq$ 1917]" post_whitedead "White casualties $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle nonumbers ///
	prehead( ) ///
	postfoot( ) refcat(post_dead "\textbf{Panel B:} Agrarian Party", nolabel)

est clear

reg mean_right c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
display beta
eststo: reghdfe mean_right post_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_dead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_insurgency if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_whitedead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_dead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_insurgency if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_whitedead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

esttab est* using "$tables/table_6.tex", append  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean beta, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean" "Standardized effect size") ///
	fmt(0 2 2 2)) keep(post_dead post_insurgency post_whitedead ) coeflabels(post_dead "Civil war casualties $\times$ 1[Year $\geq$ 1917]" ///
	post_insurgency "Red casualties $\times$ 1[Year $\geq$ 1917]" post_whitedead "White casualties $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle nonumbers ///
	prehead( ) ///
	postfoot(\bottomrule \end{tabular}) refcat(post_dead "\textbf{Panel C:} Right-wing parties", nolabel)

restore

********************************************************************************

* Figure OA10 
	
levelsof year, local(level)
foreach l of local level {
		gen treat_`l'=0
		replace treat_`l'=dead if year==`l'
	}

tempfile t1 t2
parmby "reghdfe red_parties treat_1910 treat_1911 treat_1913 treat_1917 treat_1919 treat_1922 treat_1924 treat_1927 treat_1929 treat_1930 treat_1933 treat_1936 treat_1983 treat_1987 treat_1991 treat_1995 treat_1999 treat_2003 treat_2007 treat_2011 treat_2015 treat_2019, a(munig year#laanig year#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)", lab saving(`"`t1'"',replace) idn(1) ids(Unadjusted)

preserve
clear all
set obs 1
gen year =1916
gen estimate = 0
gen parm ="treat_1916"
gen min95 =0
gen max95 =0
append using `t1'
keep if regexm(parm, "^treat*")
gen yearstr =substr(parm, -4,4)
destring yearstr, replace
sort yearstr

twoway  (rcap min95 max95 yearstr, lwidth(medium) ylabel(,format(%9.0f)) scheme(plotplain) xsize(16) ysize(9) xtitle(Year, size(small))  yline(0, lcolor(black)) xline(1916.5, lcolor(black))  xline(1918, lcolor(black)) ytitle(Regression coefficient) ///
xlabel(1910 1911 1913 1916 1917 1919 1922 1924 1927 1929 1930 1933 1936 1983 1987 1991 1995 1999 2003 2007 2011 2015 2019, angle(vertical) labsize(tiny)) graphregion(color(white)) legend(off)) (connected estimate yearstr, msize(medium) msymbol(circle) mcolor(black))

graph export "$figures/figure_OA10.pdf", as(pdf) replace
	
restore

********************************************************************************

* Figure OA11

drop treat*

levelsof year, local(level)
foreach l of local level {
		gen treat_`l'=0
		replace treat_`l'=dead if year==`l'
	}

tempfile t1 t2
parmby "reghdfe agrarian_party treat_1910 treat_1911 treat_1913 treat_1917 treat_1919 treat_1922 treat_1924 treat_1927 treat_1929 treat_1930 treat_1933 treat_1936 treat_1983 treat_1987 treat_1991 treat_1995 treat_1999 treat_2003 treat_2007 treat_2011 treat_2015 treat_2019, a(munig year#laanig year#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)", lab saving(`"`t1'"',replace) idn(1) ids(Unadjusted)

preserve
clear all
set obs 1
gen year =1916
gen estimate = 0
gen parm ="treat_1916"
gen min95 =0
gen max95 =0
append using `t1'
keep if regexm(parm, "^treat*")
gen yearstr =substr(parm, -4,4)
destring yearstr, replace
sort yearstr

twoway  (rcap min95 max95 yearstr, lwidth(medium) ylabel(,format(%9.0f)) scheme(plotplain) xsize(16) ysize(9) xtitle(Year, size(small))  yline(0, lcolor(black)) xline(1916.5, lcolor(black))  xline(1918, lcolor(black)) ytitle(Regression coefficient) ///
xlabel(1910 1911 1913 1916 1917 1919 1922 1924 1927 1929 1930 1933 1936 1983 1987 1991 1995 1999 2003 2007 2011 2015 2019, angle(vertical) labsize(tiny)) graphregion(color(white)) legend(off)) (connected estimate yearstr, msize(medium) msymbol(circle) mcolor(black))

graph export "$figures/figure_OA11.pdf", as(pdf) replace
	
restore	

********************************************************************************

* Figure OA12
	
drop treat*

levelsof year, local(level)
foreach l of local level {
		gen treat_`l'=0
		replace treat_`l'=dead if year==`l'
	}

tempfile t1 t2
parmby "reghdfe right_wing treat_1910 treat_1911 treat_1913 treat_1917 treat_1919 treat_1922 treat_1924 treat_1927 treat_1929 treat_1930 treat_1933 treat_1936 treat_1983 treat_1987 treat_1991 treat_1995 treat_1999 treat_2003 treat_2007 treat_2011 treat_2015 treat_2019, a(munig year#laanig year#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)", lab saving(`"`t1'"',replace) idn(1) ids(Unadjusted)

preserve
clear all
set obs 1
gen year =1916
gen estimate = 0
gen parm ="treat_1916"
gen min95 =0
gen max95 =0
append using `t1'
keep if regexm(parm, "^treat*")
gen yearstr =substr(parm, -4,4)
destring yearstr, replace
sort yearstr

twoway  (rcap min95 max95 yearstr, lwidth(medium) ylabel(,format(%9.0f)) scheme(plotplain) xsize(16) ysize(9) xtitle(Year, size(small))  yline(0, lcolor(black)) xline(1916.5, lcolor(black))  xline(1918, lcolor(black)) ytitle(Regression coefficient) ///
xlabel(1910 1911 1913 1916 1917 1919 1922 1924 1927 1929 1930 1933 1936 1983 1987 1991 1995 1999 2003 2007 2011 2015 2019, angle(vertical) labsize(tiny)) graphregion(color(white)) legend(off)) (connected estimate yearstr, msize(medium) msymbol(circle) mcolor(black))

graph export "$figures/figure_OA12.pdf", as(pdf) replace
	
restore	

********************************************************************************

* Table OA10

preserve

// Keep only one observation before and after & generate some variables that are needed

gen post = 0
replace post = 1 if year >= 1917

drop if year >= 1917 & year <= 1936

bysort munig post: egen mean_center = mean(agrarian_party)
bysort munig post: egen mean_right = mean(right_wing)
bysort munig post: egen mean_red = mean(red_parties)

duplicates drop munig post, force

foreach var of varlist dead insurgency whitedead {
	summarize `var', detail
	gen high_`var' = (`var'>=r(p50)) if `var' != .
	gen post_high_`var' = post * high_`var'
}

// Left-wing parties

est clear

eststo: reghdfe mean_red post_high_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

eststo: reghdfe mean_red post_high_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

eststo: reghdfe mean_red post_high_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm


esttab est* using "$tables/table_OA10.tex", replace booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean") ///
	fmt(0 2 2 2)) keep(post_high_dead post_high_insurgency post_high_whitedead ) coeflabels(post_high_dead "1[High civil war casualties] $\times$ 1[Year $\geq$ 1917]" ///
	post_high_insurgency "1[High Red casualties] $\times$ 1[Year $\geq$ 1917]" post_high_whitedead "1[High White casualties] $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle ///
	prehead(\begin{tabular}{l*{4}{c}} \toprule) refcat(post_high_dead "\textbf{Panel A:} Left-wing parties", nolabel) ///
	postfoot( )

// Agrarian Party

est clear

eststo: reghdfe mean_center post_high_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

eststo: reghdfe mean_center post_high_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

eststo: reghdfe mean_center post_high_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

esttab est* using "$tables/table_OA10.tex", append  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean") ///
	fmt(0 2 2 2)) keep(post_high_dead post_high_insurgency post_high_whitedead ) coeflabels(post_high_dead "1[High civil war casualties] $\times$ 1[Year $\geq$ 1917]" ///
	post_high_insurgency "1[High Red casualties] $\times$ 1[Year $\geq$ 1917]" post_high_whitedead "1[High White casualties] $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle nonumbers ///
	prehead( ) ///
	postfoot( ) refcat(post_high_dead "\textbf{Panel B:} Agrarian Party", nolabel)

// Right-wing parties

est clear

eststo: reghdfe mean_right post_high_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

eststo: reghdfe mean_right post_high_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

eststo: reghdfe mean_right post_high_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd ysumm

esttab est* using "$tables/table_OA10.tex", append  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean") ///
	fmt(0 2 2 2)) keep(post_high_dead post_high_insurgency post_high_whitedead ) coeflabels(post_high_dead "1[High civil war casualties] $\times$ 1[Year $\geq$ 1917]" ///
	post_high_insurgency "1[High Red casualties] $\times$ 1[Year $\geq$ 1917]" post_high_whitedead "1[High White casualties] $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle nonumbers ///
	prehead( ) ///
	postfoot(\bottomrule \end{tabular}) refcat(post_high_dead "\textbf{Panel C:} Right-wing parties", nolabel)
	
restore

********************************************************************************

* Table OA16

preserve

replace red_region = 1 if laani == "Turun ja Porin lääni"
replace red_region = 1 if laani == "Viipurin lääni"

// Generate some variables needed for the analysis & drop unnecessary years

gen post = 0
replace post = 1 if year >= 1917

drop if year >= 1917 & year <= 1936

bysort munig post: egen mean_center = mean(agrarian_party)
bysort munig post: egen mean_right = mean(right_wing)
bysort munig post: egen mean_red = mean(red_parties)

gen post_dead=dead*post
gen post_insurgency=insurgency*post
gen post_whitedead=whitedead*post

duplicates drop munig post, force

est clear

reg mean_red c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
display beta
eststo: reghdfe mean_red post_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_dead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_insurgency if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_whitedead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_dead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_insurgency if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_red c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_red post_whitedead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

esttab est* using "$tables/table_OA16.tex", replace  mgroups("Entire country" "Red Finland" "White Finland",  pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}) )  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean beta, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean" "Standardized effect size") ///
	fmt(0 2 2 2)) keep(post_dead post_insurgency post_whitedead ) coeflabels(post_dead "Civil war casualties $\times$ 1[Year $\geq$ 1917]" ///
	post_insurgency "Red casualties $\times$ 1[Year $\geq$ 1917]" post_whitedead "White casualties $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle ///
	prehead(\begin{tabular}{l*{10}{c}} \toprule) refcat(post_dead "\textbf{Panel A:} Left-wing parties", nolabel) ///
	postfoot( )

est clear

reg mean_center c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
display beta
eststo: reghdfe mean_center post_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_dead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_insurgency if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_whitedead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_dead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_insurgency if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_center c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_center post_whitedead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

esttab est* using "$tables/table_OA16.tex", append  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean beta, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean" "Standardized effect size") ///
	fmt(0 2 2 2)) keep(post_dead post_insurgency post_whitedead ) coeflabels(post_dead "Civil war casualties $\times$ 1[Year $\geq$ 1917]" ///
	post_insurgency "Red casualties $\times$ 1[Year $\geq$ 1917]" post_whitedead "White casualties $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle nonumbers ///
	prehead( ) ///
	postfoot( ) refcat(post_dead "\textbf{Panel B:} Agrarian Party", nolabel)

est clear

reg mean_right c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
display beta
eststo: reghdfe mean_right post_dead, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_insurgency , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m), beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_whitedead , absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_dead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_insurgency if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 1, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_whitedead if red_region == 1, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.dead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_dead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.insurgency##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_insurgency if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

reg mean_right c.whitedead##i.post i.munig i.post##(i.laanig c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m) if red_region == 0, beta
scalar beta = r(PT)[5,6]
eststo: reghdfe mean_right post_whitedead if red_region == 0, absorb(munig post#laanig post#(c.gini_1904 c.pop_present_all c.lat c.lon c.slope_mean c.altitude_m)) vce(cluster munig)
estadd scalar beta
estadd ysumm

esttab est* using "$tables/table_OA16.tex", append  booktabs   ///
	compress lines star(* .1 ** .05 *** .01) ///
	b(%9.3f) se(%9.3f) stats(N r2 ymean beta, labels("\textit{N}"  "\textit{R\textsuperscript{2}}" "Outcome mean" "Standardized effect size") ///
	fmt(0 2 2 2)) keep(post_dead post_insurgency post_whitedead ) coeflabels(post_dead "Civil war casualties $\times$ 1[Year $\geq$ 1917]" ///
	post_insurgency "Red casualties $\times$ 1[Year $\geq$ 1917]" post_whitedead "White casualties $\times$ 1[Year $\geq$ 1917]") nodepvars nomtitle nonumbers ///
	prehead( ) ///
	postfoot(\bottomrule \end{tabular}) refcat(post_dead "\textbf{Panel C:} Right-wing parties", nolabel)

restore
